home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / term / vltj5867.lha / VLT / rexx / VLTPhoneSetup.rexx < prev    next >
OS/2 REXX Batch file  |  1994-03-27  |  2KB  |  81 lines

  1. /** VLTPhoneSetup.rexx
  2. *
  3. *   This program sets up a VLTPhoneBook directory and assigns VLTPhoneBook:
  4. *   to it. Must be run from inside VLT.
  5. *
  6. *   By W.G.J. Langeveld, February 1992.
  7. *
  8. **/
  9. /*
  10. *   Add libraries if necessary
  11. */
  12. if show("l", "rexxarplib.library") = 0 then do
  13.    check = addlib('rexxsupport.library', 0, -30, 0)
  14.    check = addlib('rexxarplib.library',  0, -30, 0)
  15. end
  16. /*
  17. *   Determine port and screen name and size
  18. */
  19. vltport = address()
  20. cols = ScreenCols(vltport)
  21. if cols == -1 then do
  22.    vltscreen = ""
  23.    cols = ScreenCols()
  24.    rows = ScreenRows()
  25. end
  26. else do
  27.    vltscreen = vltport
  28.    rows = ScreenRows(vltscreen)
  29. end
  30. /*
  31. *   Check if the assignment already exists. If not ask if we should
  32. *   make one.
  33. */
  34. call pragma('W','NULL')
  35.  
  36. if ~exists("VLTPhoneBook:") then do
  37.    prompts = "You have no VLT PhoneBook assignment.\"
  38.    prompts = prompts || "Do you want to make one now?"
  39.  
  40.    test = Request(80, 50, prompts, , " Okay ", " Cancel ", vltscreen)
  41.    if test == "" then exit
  42. end
  43. /*
  44. *   Get a directory name for the phonebook.
  45. */
  46. do forever
  47.    test = GetFile(80, 50,,, "Select PhoneBook Directory", vltscreen,"SAVE+NOFILES")
  48.    if test == "" then exit
  49.  
  50.    if ~exists(test) then do
  51.       "message (Directory: "test" does not exist - try again); delay 1.5"
  52.       iterate
  53.    end
  54.    else leave
  55. end
  56. /*
  57. *   Make the assignment.
  58. */
  59. number = FileList(test, files, "D", "E")
  60. test = files.1
  61.  
  62. address COMMAND "assign >nil: VLTPhoneBook: "test
  63.  
  64. if ~exists("VLTPhoneBook:T") then do
  65.    address COMMAND "makedir >nil: VLTPhoneBook:T"
  66. end
  67.  
  68. if ~exists("VLTPhoneBook:T/dial_file") then do
  69.    address COMMAND 'echo >VLTPhoneBook:T/dial_file " "'
  70. end
  71.  
  72. msg =        "You should probably put an  assignment in your" || '0a'x
  73. msg = msg || "startup sequence:" || '0a'x
  74. msg = msg || "assign VLTPhoneBook: " || test '0a'x || '0a'x
  75. msg = msg || "You may also want to edit VLTPhoneDial.rexx if" || '0a'x
  76. msg = msg || "your modem is not Hayes compatible."
  77.  
  78. "message ("msg")"
  79.  
  80. exit
  81.